<script>
    // var ws = new WebSocket('ws://10.177.96.147:10091/websocket');
    // var ws = new WebSocket('ws://www.donald.com/websocket');
    console.log(ws.url);
    ws.onopen = function () {
        console.log('ws onopen');
        console.log(ws.url);
        var reqestData = {
            /*   "ssh": {
                   "ip":"192.168.230.129",
                   "port":"22",
                   "username":"donaldhan",
                   "password":"123456",
                   "keysFilePath":"/home/donaldhan/id_rsa",
                   "keysPassphrase":"123456"
               }, */
            // "content": "/home/donaldhan/logs/tail_agent_log.log"
            // "content": "logs/tail_agent_log.log"
            "content": "node0/log/log"

        };
        /*
        var reqestData = {};  
        reqestData.sshInfo.ip = "192.168.230.129";  
        reqestData.sshInfo.port = '22'; 
        reqestData.sshInfo.username = 'donaldhan';
        reqestData.sshInfo.password = '123456';
        reqestData.sshInfo.keysFilePath="/home/donaldhan/id_rsa";
        reqestData.sshInfo.keysPassphrase=":"123456";
        reqestData.content = "/home/donaldhan/logs/tail_agent_log.log" ;
        */
        //object
        console.log(typeof reqestData);
        console.log(reqestData);
        var msg = JSON.stringify(reqestData);
        console.log(msg);
        ws.send(msg);
    };
    ws.onmessage = function (e) {
        console.log(ws.url);
        console.log('ws onmessage');
        console.log('from server: ' + e.data);
    };
</script>